package com.ruoyi.controller;


import com.ruoyi.pojo.SysUser;
import com.ruoyi.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
@RequestMapping
public class LoginController {
    @Autowired
    private SysUserService userService;

    @PostMapping("/getLogin")
    public String getLogin(String loginName,String password){
        SysUser login = userService.getLogin(loginName, password);
        ModelAndView modelAndView = new ModelAndView();
        if (login!= null){
            return "index";
        }else {
            return "logins";
        }
    }
}
